﻿using Quartz;
using System.ComponentModel;
/// <summary>
/// 系统中共用的数据类型定义配置表
/// </summary>
namespace PMS.Core.Configuration.CommonEnumConfigs
{

    #region SystemRespondConfigs
    /// <summary>
    /// 前后端交互结束后返回的系统调用结果定义
    /// </summary>
    public enum RespondNotifyType
    {
        /// <summary>
        /// Success
        /// </summary>
        Success = 200,
        /// <summary>
        /// Error
        /// </summary>
        Error = 201,
        /// <summary>
        /// Warning
        /// </summary>
        Warning = 202,
        /// <summary>
        /// UrlRedirect
        /// </summary>
        RedirectUrl = 302,
        /// <summary>
        /// NotFound
        /// </summary>
        NotFound404 = 404,

    }
    #endregion

    #region SystemConfigs
    /// <summary>
    /// Represents a log level
    /// </summary>
    public enum SystemLogLevel
    {
        /// <summary>
        /// Debug
        /// </summary>
        Debug = 10,

        /// <summary>
        /// Information
        /// </summary>
        Information = 20,

        /// <summary>
        /// Warning
        /// </summary>
        Warning = 30,

        /// <summary>
        /// Error
        /// </summary>
        Error = 40,

        /// <summary>
        /// Fatal
        /// </summary>
        Fatal = 50
    }
    /// <summary>
    /// SSL requirement
    /// </summary>
    public enum SslRequirement
    {
        /// <summary>
        /// Page should be secured
        /// </summary>
        Yes,
        /// <summary>
        /// Page should not be secured
        /// </summary>
        No,
        /// <summary>
        /// It doesn't matter (as requested)
        /// </summary>
        NoMatter,
    }
    #endregion

    #region PluginConfigs
    /// <summary>
    /// Represents a mode to load plugins
    /// </summary>
    public enum LoadPluginsMode
    {
        /// <summary>
        /// All (Installed and Not installed)
        /// </summary>
        All = 0,

        /// <summary>
        /// Installed only
        /// </summary>
        InstalledOnly = 10,

        /// <summary>
        /// Not installed only
        /// </summary>
        NotInstalledOnly = 20
    }

    #endregion

    #region LoginConfigs
    /// <summary>
    /// 账号验证方式
    /// </summary>
    public enum AuthenticationType
    {
        /// <summary>
        /// Json web token
        /// </summary>
        JwtAuth = 1,
        /// <summary>
        /// Cookie
        /// </summary>
        CookieAuth = 2
    }
         
    /// <summary>
    /// 用户登录方式
    /// </summary>
    public enum LoginType
    {
        /// <summary>
        /// 账号密码+验证码登录
        /// </summary>
        Password = 1,
        /// <summary>
        /// 短信验证码
        /// </summary>
        SMS = 2,
        /// <summary>
        /// 微信授权认证
        /// </summary>
        Wechat = 3,
    }

    /// <summary>
    /// Represents the customer login result enumeration
    /// </summary>
    public enum CustomerLoginResults
    {
        /// <summary>
        /// Login successful
        /// </summary>
        Successful = 1,

        /// <summary>
        /// Customer does not exist (email or username)
        /// </summary>
        CustomerNotExist = 2,

        /// <summary>
        /// Wrong password
        /// </summary>
        WrongPassword = 3,

        /// <summary>
        /// Account have not been activated
        /// </summary>
        NotActive = 4,

        /// <summary>
        /// Customer has been deleted 
        /// </summary>
        Deleted = 5,

        /// <summary>
        /// 限制登录，三次输错密码则限制时间内不能登录
        /// 超过五次锁定账号
        /// </summary>
        LoginLimitition = 6,

        /// <summary>
        /// Locked out
        /// </summary>
        LockedOut = 7,

        /// <summary>
        /// 通过第三方账号(如微信等)授权认证失败
        /// </summary>
        OAuth2Failed = 8
    }
    /// <summary>
    /// 资源访问权限控制，主要配合FilterAttribute实现后台受保护资源访问控制
    /// </summary>
    public enum CustomerAuthorizeType
    {
        Ignore = 1,
        Guests = 2,
        Admin = 3,
        Administrator = 4,
        BuildInTaskUser = 5
    }
    #endregion

    #region EntityConfigs

    /// <summary>
    /// 公用数据 导航按钮/模块打开方式
    /// 如为页面拉链/按钮 可指定点击链接打开方式
    /// </summary>
    public enum LinkOpenMode
    {
        /// <summary>
        /// 1：链接为页内弹窗则不响应默认事件
        /// 2：链接为导航菜单(如折叠或更多效果)则不响应默认事件，只展开其子菜单
        /// </summary>
        [Description("无链接导航")]
        None = 1,
        /// <summary>
        /// 页内Tab效果使用ifrmae展示Url内容
        /// </summary>
        [Description("页内标签导航")]
        IFrame = 2,
        /// <summary>
        /// 新窗口打开Url, 对应 html a target="_blank"
        /// </summary>
        [Description("新窗口打开")]
        NewWindow = 4,
        /// <summary>
        /// 页内链接跳转， 对应 js window.location.href = url 或 html a target="_self"
        /// </summary>
        [Description("页面跳转")]
        PageRedirect = 8
    }

    #region Customers
    public enum RoleType
    {
        /// <summary>
        /// 系统内置角色 Guests For Regular Customer Registration
        /// </summary>
        Guests = 1,
        /// <summary>
        /// 系统内置角色 Backend TaskUser for Job Schedules
        /// </summary>
        BuildInTaskUser = 2,
        /// <summary>
        /// 系统内置角色 AdminUser with Top Priority Backend AccessControl
        /// 系统管理员拥有后台系统访问最高权限，无需要配置角色权限
        /// </summary>
        Administrator = 3,
        /// <summary>
        /// 系统内置角色 Regular BackendUser for Visiting Backend System
        /// 普通系统管理员需要配合权限分配才能确定后台操作权限
        /// </summary>
        BackendUser = 4,
    }
    /// <summary>
    /// Password format
    /// </summary>
    public enum PasswordFormat
    {
        /// <summary>
        /// Clear
        /// </summary>
        Clear = 0,

        /// <summary>
        /// Hashed
        /// </summary>
        Hashed = 1,

        /// <summary>
        /// Encrypted
        /// </summary>
        Encrypted = 2
    }
    /// <summary>
    /// 前端在用户注册或更改密码时校验输入密码强度
    /// 分别对应 低/中/高三个级别
    /// </summary>
    public enum PasswordStrongLevel
    {
        /// <summary>
        /// 简单字母/数字组合，不超过6位
        /// </summary>
        Weak = 1,
        /// <summary>
        /// 字母数据组合，6-12位
        /// </summary>
        Good = 2,
        /// <summary>
        /// 包含小写字母，大写字母，数字及特殊字符的组合，且密码在8-20位
        /// </summary>
        Strong = 3
    }

    /// <summary>
    /// Represents the customer registration type formatting enumeration
    /// 用户注册设定
    /// </summary>
    public enum UserRegistrationType
    {
        /// <summary>
        /// 适合手机移动端App使用，只需要提供手机号完成注册
        /// 用户可使用密码或短信验证码(需要配合短信服务)登录
        /// 其余信息(如登录名/Email)使用默认
        /// </summary>
        MobileOnly = 1,
        /// <summary>
        /// Standard account creation
        /// 标准注册流程：登录名/手机号/Email+密码 注册
        /// </summary>
        Standard = 2,

        /// <summary>
        /// Email validation is required after registration
        /// 用户注册完成后需要通过发送邮箱验证邮件才能完成注册
        /// </summary>
        EmailValidation = 3,

        /// <summary>
        /// A customer should be approved by administrator
        /// 用户注册完成后需要管理员通过审核才能使用
        /// </summary>
        AdminApproval = 4,

        /// <summary>
        /// Registration is disabled
        /// 用户注册功能关闭
        /// </summary>
        Disabled = 5
    }

    /// <summary>
    /// 用户账号绑定/更换时绑定对象
    /// </summary>
    public enum AccountBindMode
    {
        /// <summary>
        /// 当前绑定/更换的是手机号码
        /// </summary>
        MobilePhone = 1,
        /// <summary>
        /// 当前绑定/更换的是邮箱账号
        /// </summary>
        Email = 2,
        /// <summary>
        /// 当前绑定/更换的是登录账号
        /// </summary>
        LoginName = 3
    }
    #endregion

    #region SMSAccount
    /// <summary>
    /// 标识账号发送的短信归属类型：如营销短信，验证类短信，营销短信等。
    /// </summary>
    public enum SMSAccountMsgType
    {
        /// <summary>
        /// 验证类短信
        /// </summary>
        VerifyCode = 1,
        /// <summary>
        /// 短信通知
        /// </summary>
        NotifyMsg = 2,
        /// <summary>
        /// 批量营销短信
        /// </summary>
        BatchSaleMsg = 3
    }
    #endregion

    #region EmailAccount
    /// <summary>
    /// 发送邮件账号类型
    /// </summary>
    public enum EmailAccountType
    {
        /// <summary>
        /// 自建邮件推送，后续有需要再实现
        /// </summary>
        SelfMailService = 1,
        /// <summary>
        /// 阿里云邮件推送服务
        /// </summary>
        AliyunDirectMail = 2,
    }
    /// <summary>
    /// 发送邮件的邮箱账号类型(针对阿里云DirectMail推送)
    /// 如有其他推送服务，后续增加
    /// </summary>
    public enum EmailSenderType
    {
        /// <summary>
        /// 如果自建邮箱推送服务或其他邮件推送
        /// 后续增加相应类型
        /// </summary>
        None = 0,
        /// <summary>
        /// (针对阿里云DirectMail推送)
        /// 触发邮件：由事件触发的邮件，如注册通知、交易通知、验证找密等系统通知邮件。
        /// </summary>
        SingleMailSender = 1,
        /// <summary>
        /// (针对阿里云DirectMail推送)
        /// 批量邮件：发送给会员的订阅邮件，如产品推广、用户关怀、期刊资讯等邮件。
        /// </summary>
        BatchMailSender = 2
    }
    #endregion

    #region QueuedEmail
    /// <summary>
    /// Represents priority of queued email
    /// </summary>
    public enum QueuedEmailPriority
    {
        /// <summary>
        /// Low
        /// </summary>
        Low = 0,

        /// <summary>
        /// High
        /// </summary>
        High = 5
    }

    #endregion

    #region ScheduleJobTask
    /// <summary>
    /// 后台计划任务状态码
    /// </summary>
    public enum ScheduleJobActionStatus
    {
        /// <summary>
        /// 定时周期性任务状态，未运行过(初始化添加) 可执行状态
        /// </summary>
        Normal = TriggerState.Normal,
        /// <summary>
        /// 任务处于暂停状态，可唤醒继续执行
        /// </summary>
        Paused = TriggerState.Paused,
        /// <summary>
        /// 任务自动执行后标识状态，可等待再次唤醒执行
        /// </summary>
        Complete = TriggerState.Complete,
        /// <summary>
        /// 计划任务遇到异常/错误退出时终止执行，
        /// </summary>
        Error = TriggerState.Error,
        /// <summary>
        /// Stop状态针对所有任务(不论单次或是周期性任务)，程序不主动标识Stop,只能由人工手动停止并标识
        /// Stop状态任务不自动唤醒执行，只能人工手动启动
        /// </summary>
        Stop = 10
    }

    /// <summary>
    /// 后台计划任务操作模式
    /// </summary>
    public enum JobAction
    {
        //新增 Job
        AddJob = 1,
        //删除 = 2,
        DeleteJob = 2,
        //修改 = 3,
        ModifyJob = 3,
        //暂停 = 4,
        PauseJob = 4,
        //停止,
        StopJob = 5,
        //开启/恢复, 与暂停相对应， 任务开启不一定会立即执行，而是按任务的执行时间计划，到预定义时间自动触发执行
        ResumeJob = 6,
        //立即执行
        ExecuteJob = 7
    }
    /// <summary>
    /// 计划任务的分组，后续有分组在此添加
    /// </summary>
    public enum ScheduleJobGroup
    {
        /// <summary>
        /// 默认分组，后台系统等运维，如日志清理等
        /// </summary>
        [Description("系统运维")]
        SystemTasks = 1,
        /// <summary>
        /// 邮件分组，针对队列邮件的计划任务，定时发送广告或触发邮件等
        /// </summary>
        [Description("队列邮件")]
        QueuedEmailTasks = 2
    }
    #endregion

    #region SystemModules
    /// <summary>
    /// 按钮按功能分组，不论数据列表模块或是功能页面模块，按按钮操作数据摆放位置分组。
    /// usage: In Razor Page
    /// @foreach (var name in Html.GetEnumSelectList(typeof(ModuleButtonGroup)))
    /// {
    ///     <h1>@(name.Value.ToEnum<ModuleButtonGroup>().GetDescription(true))</h1>
    /// }
    /// 
    /// Or
    /// foreach (var item in typeof(ModuleButtonGroup).GetEnumValues())
    /// {
    ///     Console.WriteLine("name: " + ((ModuleButtonGroup) item).GetDescription());
    /// }
    /// 
    /// For FlagsAttribute see: https://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c
    /// </summary>
    public enum ModuleButtonGroup
    {
        /// <summary>
        /// 顶部功能按钮：如批量数据操作按钮；
        /// </summary>
        [Description("顶部功能按钮")]
        HeadButtonsGroup = 1,

        /// <summary>
        /// 数据行操作按钮：数据行中数据对应操作按钮
        /// </summary>
        [Description("数据行操作按钮")]
        RecordButtonsGroup = 2,

        /// <summary>
        /// 底部数据操作按钮：如功能页面底部保存按钮
        /// </summary>
        [Description("底部功能按钮")]
        FootButtonGroup = 3
    }

    /// <summary>
    /// 系统模块按钮在页面显示时展示方式
    /// </summary>
    public enum ModuleButtonDisplayMode
    {
        /// <summary>
        /// 顶部功能按钮：如批量数据操作按钮；
        /// </summary>
        [Description("只显示按钮名称")]
        DisplayNameOnly = 1,

        /// <summary>
        /// 数据行操作按钮：数据行中数据对应操作按钮
        /// </summary>
        [Description("只显示图标")]
        IconOnly = 2,

        /// <summary>
        /// 底部数据操作按钮：如功能页面底部保存按钮
        /// </summary>
        [Description("图标及名称")]
        DisplayNameAndIconBoth = 3
    }
    #endregion

    #region Media
    public enum MediaFileType
    {
        Unknown = 0,
        /// <summary>
        /// Picture like jpeg,jpg,gif,png etc
        /// </summary>
        Image = 1,
        /// <summary>
        /// Audio like mp3,wav etc
        /// </summary>
        Audio = 2,
        /// <summary>
        /// text files like txt, doc, pdf etc
        /// </summary>
        TextFile = 3,
        /// <summary>
        /// Video file like mp4,webm etc
        /// </summary>
        Video = 4,
        /// <summary>
        /// ZipFile like rar, zip etc
        /// </summary>
        ZipFile = 5
    }

    /// <summary>
    /// 媒体文件存储方式
    /// </summary>
    public enum MediaFileStoreMode
    {
        /// <summary>
        /// 本地文件系统存储
        /// </summary>
        LocalFile = 1,
        /// <summary>
        /// 七牛云存储
        /// </summary>
        QiniuCloud = 2,
        /// <summary>
        /// 青云存储
        /// </summary>
        QingStor = 3
    }

    public enum MediaFileUseage
    {
        [Description("默认分类")]
        Default = 1,
        [Description("用户头像")]
        Avatar = 2,
        [Description("文章模块")]
        Article = 3,
        [Description("商品模块")]
        Products = 4,
        [Description("商品评论")]
        ProductsComment = 5,
        //如有其他用途在此后顺序添加
    }
    #endregion

    #region NaviMenus
    /// <summary>
    /// 导航栏目菜单在页面展现时对应的模板展示类型
    /// </summary>
    public enum LayoutTemplateType
    {
        [Description("数据列表")]
        DataLists = 1,
        /// <summary>
        /// 单页详情页，和文章或商品挂勾展示指定文章或商品的详情页
        /// </summary>
        [Description("单页详情")]
        SinglePageDetail = 2,
        /// <summary>
        /// 如联系我们页输入留言信息等不与具体文章或商品挂勾，具有独立页面功能的定制页面
        /// </summary>
        [Description("功能页面")]
        SinglePageApplication = 3
    }

    /// <summary>
    /// NaviMenuGroup Names
    /// </summary>
    public enum MenuGroups
    {
        Articles = 1,
        Products= 2,
        Blogs   = 3
    }
    #endregion

    #endregion
}